package com.ydc.controller;

import com.ydc.pojo.Rights;
import com.ydc.pojo.RightsUser;
import com.ydc.service.RightsService;
import com.ydc.vo.SysResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/rights")
@Api(tags = "右侧菜单栏")
public class RightsController {

    @Autowired
    private RightsService rightsService;
    @ApiOperation("获取右侧菜单集合")
    @GetMapping("/getRightsList")
    public SysResult getRightsList() {
        List<Rights> rightsList = rightsService.findRightsList();
        return SysResult.success(rightsList);
    }
    @ApiOperation("获取右侧菜单集合")
    @GetMapping("/getRightsUserList")
    public SysResult getRightsUserList() {
        List<RightsUser> rightsUserList = rightsService.getRightsUserList();
        return SysResult.success(rightsUserList);
    }
}
